<?php

//礼券密码表
class card extends spModel
{
	public $pk = "id"; // 数据表的主键
    public $table = "cards"; // 数据表的名称

	function create($row) {
		$mTicket  = spClass('ticket');
		$ticket   = $mTicket->find(array('id'=>$row['tid']));

		$mUserLog = spClass('userlog');
		$logArray	  = array(
							'uid' => $row['uid'],
							'type'=> 'addcard',
							'content' => 'Add card '.$ticket['name'].': number is '.$row['number'].' and password is '.$row['password'],
							'dateline'=> time()
						);
		$lastLogId    = $mUserLog->create($logArray);
		parent::create($row);
	}

}